'''
Created on 2011-5-2

@author: miraclew
'''
from jxgame.globals.GlobalDef import INVALID_TABLE
from jxgame.game.land.Cmd import GS_LAND_FREE

########################_#######################_#######################

class TableFrame:
    #属性变量
    table_id            = 0                     #桌子号码
    chair_count         = 0                     #椅子数目
    
    #状态变量
    locked              = False                 #锁定标志
    game_stated         = False                 #开始标志
    game_status         = 0                     #游戏状态
    start_time          = 0                     #开始时间
    table_owner_id      = 0                     #台主ID
    password            = None                  #桌子密码
    
    #分数信息
    game_tax            = 0                     #游戏税收
    player_id           = []                    #玩家ID
    score_info          = []                    #游戏金蛋
    
    #用户信息
    allow_look_on       = []                    #旁观标志
    off_line_count      = []                    #断线次数
    table_user         = []                    #用户指针
    look_on_user        = []                    #旁观用户
    
    #配置信息
    game_service_attr   = None                  #服务属性
    game_servie_option  = None                  #服务配置
    
    #对象接口
    table_frame_sink    = None                  #桌子接口
    table_user_action   = None                  #事件接口
    
    def __init__(self):
        self.chair_count = 0
        self.table_id = INVALID_TABLE
        self.locked = False
        self.game_stated = False
        self.start_time = 0
        self.table_owner_id = 0
        self.password = ''
        self.game_status = GS_LAND_FREE
        self.game_tax = 0
        self.score_info = []
        self.player_id = []
        
        #用户信息
        self.table_user = []
        self.game_service_attr = None
        self.game_servie_option = None
        
        #接口变量
        self.table_frame_sink = None
        self.table_user_action = None
         
    def init_table_frame(self, table_id, table_frame_parameter):
        self.table_id = table_id
        self.game_service_attr = table_frame_parameter.game_service_attr    
        self.game_servie_option = table_frame_parameter.game_servie_option    
        self.chair_count = table_frame_parameter.game_service_attr.chair_count
        self.database_event = table_frame_parameter.database_event
        
        self.game_service_frame = None #调度服务?
        
    
    #用户接口
    def EnumLookonUserItem(self):
        pass
    
    def GetServerUserItem(self):
        pass
    
    #定时器接口
    def SetGameTimer(self, timer_id, elapse, repeat, param):
        pass
    
    def KillGameTimer(self, timer_id):
        pass
    
    #网络接口
    def SendUserData(self):
        pass
    
    def SendTableData(self):
        pass
    
    def SendLookonData(self):
        pass
    
    #消息接口
    def SendRoomMessage(self):
        pass
    
    def SendGameMessage(self):
        pass
    
    #游戏接口
    def DismissGame(self):
        pass
    
    def ConcludeGame(self):
        pass
    
    def SendGameScene(self):
        pass
    
    #写分接口
    def WriteUserScore(self):
        pass
    
    #执行接口
    def PerformSitDownAction(self):
        pass
    
    def PerformLookonAction(self):
        pass
    
    def PerformStandUpAction(self):
        pass
    
    #用户事件
    def OnUserOffLine(self):
        pass
    
    def OnUserReConnect(self):
        pass
    
    def OnUserReqOffLine(self):
        pass
    
    #系统事件
    def OnEventTimer(self):
        pass
    
    def OnEventSocketGame(self):
        pass
    
    def OnEventSocketFrame(self):
        pass
    
    def OnEventSocketVideo(self):
        pass
    
    #控制接口
    def StartGame(self):
        pass
    
    def StartVerdict(self):
        pass
    
    def ValidateCanPlay(self):
        pass
    
    #辅助函数
    def GetNullChairID(self):
        pass
    
    def SendSitFailedPacket(self):
        pass
    
    def DoUserReady(self):
        pass
    
    def SendUserItem(self):
        pass
    
    
    
